Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Speedup extract_objects #14109

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Conversation

bonzini
Copy link
Collaborator

@bonzini bonzini commented Jan 10, 2025

When building QEMU, about 10% of the time is spent in flatten_object_list due to its use of _determine_ext_objs and object_filename_from_source. With a little preparation, the results from both of these can be memoized.

This PR tackles _determine_ext_objs() and a particularly hot part of object_filename_from_source() (which is canonicalize_filename()), both of which can be (mostly) handled just with functools.lru_cache.

The proj_dir_to_build_root argument of determine_ext_objs is always empty,
remove it.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This is a very hot function, improve the memoization of the results by removing
an argument (that is almost always empty, in fact).

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
@bonzini
Copy link
Collaborator Author

bonzini commented Jan 10, 2025

TASKING added an expensive call to get_compiler_for_source() in _determine_ext_objs(), so I'm going to propose this for 1.7 as soon as CI passes.

@bonzini bonzini added this to the 1.7 milestone Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant